const mongoose = require('mongoose')
const Schema = mongoose.Schema

const billSchema = mongoose.Schema({
  source: {
    type: Schema.Types.ObjectId,
    ref: 'billSource'
  },
  state: {
    type: Number,
    default: 10
  },
  desc: {
    type: String,
    default: ''
  },
  images: {
    type: Array,
    default: []
  },
  createAt: {
    type: Date,
    default: new Date()
  },
  executor: {
    type: Schema.Types.ObjectId,
    ref: 'user'
  }
})

module.exports = mongoose.model('bill', billSchema)
